package com.shkco.feign;

import com.shkco.domain.Store;
import com.shkco.utils.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreServiceFallbackFactory implements FallbackFactory<StoreService> {
    @Override
    public StoreService create(Throwable throwable) {
        return new StoreService() {
            @Override
            public AjaxResult add(Store store) {
                return new AjaxResult(false,"触发熔断！用户服务不可用！");
            }
        };
    }
}
